package meituan;

import java.util.Scanner;

/**
 * @Author Stringzhua
 * @Date 2024/11/9 14:49
 * description:
 */
public class test02 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String input = sc.nextLine();

        String[] names = input.split("\\s+");
        int cnt=0;
        for(String name:names){
            if(Character.isUpperCase(name.charAt(0))){
                cnt++;
            }
        }
        System.out.println(cnt);
        sc.close();

    }
}
